<?php
    $sumBonus = 0.00;
    foreach($data as $d){
        $sumBonus += $d->bonus;
    }
?>

<h2 class="text-center" style="margin-top: -10px; margin-bottom: 0;">
    <small style="color: #333; font-size: 16px;">总共<br /></small>
    <?php echo round($sumBonus, 2); ?><small style="color: #333; font-size: 16px;">元</small>
</h2>

<ul class="bonus-list">
    <?php foreach($data as $d): ?>
        <li>
          <span style="float: right; font-size: 16px; line-height: 40px;"><?php echo $d->bonus; ?>元</span>
                红包<br />
          <span style="color: #aaa;"><?php echo $d->createtime; ?></span>
        </li>
    <?php endforeach; ?>
</ul>